package org.darcy.youchat.fragment;

import android.content.Intent;
import android.view.View;

import org.darcy.youchat.activity.discovery.FriendCirclePrivacySetActivity;
import org.darcy.youchat.utils.AppConst;
import org.darcy.youchat.activity.discovery.NearbyPeopleActivity;
import org.darcy.youchat.activity.home.ScanActivity;
import org.darcy.youchat.activity.home.WebViewActivity;
import org.darcy.youchat.databinding.FragmentDiscoveryBinding;

/**
 * 3.发现
 */
public class DiscoveryFragment extends BaseFragment {

    private FragmentDiscoveryBinding binding;
    private Intent mIntent;

    @Override
    public View initView() {
        binding = FragmentDiscoveryBinding.inflate(getLayoutInflater());
        return binding.getRoot();
    }

    @Override
    public void initListener() {
        //1.朋友圈设置
        binding.oivFriendsCirclePrivacySet.setOnClickListener(v->{
            startActivity(new Intent(getActivity(), FriendCirclePrivacySetActivity.class));
        });
        //2.扫一扫
        binding.oivScan.setOnClickListener(v->{
            startActivity(new Intent(getActivity(), ScanActivity.class));
        });
        //3.摇一摇
        binding.oivShake.setOnClickListener(v->{
            startActivity(new Intent(getActivity(), ScanActivity.class));
        });
        //4.附近
        binding.oivNearby.setOnClickListener(v->{
            startActivity(new Intent(getActivity(), NearbyPeopleActivity.class));
        });
        //5.购物
        binding.oivShop.setOnClickListener(v->{
            mIntent = new Intent(getActivity(), WebViewActivity.class);
            mIntent.putExtra("url", AppConst.Url.SHOP);
            mIntent.putExtra("title", "京东购物");
            startActivity(mIntent);
        });
        //6.游戏
        binding.oivGame.setOnClickListener(v->{
            mIntent = new Intent(getActivity(), WebViewActivity.class);
            mIntent.putExtra("url", AppConst.Url.GAME);
            mIntent.putExtra("title", "微信游戏");
            startActivity(mIntent);
        });
        //7.水木
        binding.oivBBS.setOnClickListener(v->{
            mIntent = new Intent(getActivity(), WebViewActivity.class);
            mIntent.putExtra("url", AppConst.Url.BBS);
            mIntent.putExtra("title", "水木清华");
            startActivity(mIntent);
        });
    }
}
